package com.william.git.model;

import cn.hutool.core.text.StrFormatter;

import java.util.Date;

/**
 * Git提交日志实体类
 * 
 * @author wuyong
 * @date 2025/1/21
 */
public class GitCommitLog {
    private String commitId;      // 提交ID
    private String authorName;    // 作者名称
    private Date commitDate;      // 提交时间
    private String message;       // 提交说明

    // 构造函数
    public GitCommitLog(String commitId, String authorName, Date commitDate, String message) {
        this.commitId = commitId;
        this.authorName = authorName;
        this.commitDate = commitDate;
        this.message = message;
    }

    @Override
    public String toString() {
        return StrFormatter.format("提交ID: {}, 作者名称: {}, 提交时间: {}, 提交说明: {}", commitId, authorName, commitDate, message);
    }

    // Getter和Setter方法
    public String getCommitId() {
        return commitId;
    }

    public void setCommitId(String commitId) {
        this.commitId = commitId;
    }

    public String getAuthorName() {
        return authorName;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    public Date getCommitDate() {
        return commitDate;
    }

    public void setCommitDate(Date commitDate) {
        this.commitDate = commitDate;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getAuthor() {
        return authorName;
    }
}